﻿ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QQ.InterviewQuestions.LinkedList
{
    public class CopyLinkedListRandom
    {
        public void Execute()
        {
            NodeList list1 = new NodeList();
            list1.Append(new Node(1));
            list1.Append(new Node(2));
            list1.Append(new Node(3));
            list1.Append(new Node(4));          
            list1.Display();
            list1.Random();
            list1.DisplayRandom();

            NodeList list2 = list1.Clone();
            list2.Display();
            list2.DisplayRandom();
            list1.Display();
            list1.DisplayRandom();
        }
    }
}
